﻿using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Xml.Serialization;
/// <summary>
/// Summary description for Base
/// </summary>
namespace CE.HotelEan
{
    public class BaseResponse
    {
        public BaseResponse(){}

        public string customerSessionId { get; set; }
        public EanWsError EanWsError { get; set; }
    }
    public class EanWsError
    {
        public EanWsError(){}

        public errorCategory category { get; set; }
        [XmlIgnore]
        public bool categorySpecified { get; set; }
        public ErrorAttributes ErrorAttributes { get; set; }
        public int exceptionConditionId { get; set; }
        public errorHandling handling { get; set; }
        [XmlIgnore]
        public bool handlingSpecified { get; set; }
        public long itineraryId { get; set; }
        public string presentationMessage { get; set; }
        public ServerInfo ServerInfo { get; set; }
        public string verboseMessage { get; set; }
    }
    public enum errorCategory
    {
        UNKNOWN = 0,
        EXCEPTION = 1,
        CREDITCARD = 2,
        DATA_VALIDATION = 3,
        AUTHENTICATION = 4,
        UNABLE_TO_PROCESS_REQUEST = 5,
        INVALID_PROPERTY_ID = 6,
        RESULT_NULL = 7,
        PROCESS_FAIL = 8,
        SOLD_OUT = 9,
        RESTRICTED_CHECKIN = 10,
        ONEROOM = 11,
        SUPPLIER_COMMUNICATION = 12,
        DATA_PARSE_RESULT = 13,
        CORPORATE_RATE = 14,
        RES_NOT_FOUND = 15,
        RES_CANCELLED = 16,
        HRN_QUOTE_KEY_FAILURE = 17,
        HRN_QUOTE_KEY_INVALID = 18,
        SYS_OFFLINE = 19,
        SUPPLIER_INITITIALIZATION = 20,
        SUPPLIER_ROUTER_EXCEPTION = 21,
        EJB_CREATE_EXCEPTION = 22,
        FINDER_EXCEPTION = 23,
        BML_FAIL = 24,
        PRICE_MISMATCH = 25,
        CSV_FAIL = 26,
        PAYER_AUTH_REQUIRED = 27,
        PAYER_AUTH_FAILED = 28,
        ITINERARY_ALREADY_BOOKED = 29,
        FRAUD = 30,
    }
    public class ErrorAttributes
    {
        public ErrorAttributes(){}

        [XmlArrayItem("entry", IsNullable = false)]
        public ErrorAttributesEntry[] errorAttributesMap { get; set; }
    }
    public class ErrorAttributesEntry
    {
        public ErrorAttributesEntry(){}

        public errorAttribute key { get; set; }
        [XmlIgnore]
        public bool keySpecified { get; set; }
        public string value { get; set; }
    }
    public enum errorAttribute
    {
        CC_TRANSACTIONSTATUS = 0,
        TRANSACTIONSTATUSMSG = 1,
        PA_TRANSACTIONSTATUS = 2,
        XID = 3,
        ACS_URL = 4,
        PA_REQ = 5,
        AUTH_CODE = 6,
        PAS_TRANSACTION_ID = 7,
        SUPPLIER_ERROR_CODE = 8,
        MULTI_ROOMTYPE_CONFIRMATIONS = 9,
        RATE_CHANGE = 10,
        RATE_KEY = 11,
    }
    public enum errorHandling
    {
        UNKNOWN = 0,
        RECOVERABLE = 1,
        UNRECOVERABLE = 2,
        AGENT_ATTENTION = 3,
    }
    public class ServerInfo
    {
        public ServerInfo(){}

        [XmlAttribute]
        public string instance { get; set; }
        [XmlAttribute]
        public string serverTime { get; set; }
        [XmlAttribute]
        public long timestamp { get; set; }
        [XmlIgnore]
        public bool timestampSpecified { get; set; }
    }
}
